<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html; charset=utf-8" language="java" isELIgnored="false" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>登录页面</title>
    <link rel="icon" href="${pageContext.request.contextPath}/static/images/favicon.ico" type="image/ico">
    <meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
    <meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
    <meta name="author" content="yinqi">
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/materialdesignicons.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/style.min.css" rel="stylesheet">
    <%--<script type="text/javascript" src="${path}/js/jquery.min.js"></script>--%>
    <%--<script type="text/javascript" src="${path}/js/bootstrap.min.js"></script>--%>
    <%--<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>--%>

    <%--<!--消息提示-->--%>
    <%--<script src="${path}/js/bootstrap-notify.min.js"></script>--%>
    <%--<script type="text/javascript" src="${path}/js/lightyear.js"></script>--%>
    <%--<script type="text/javascript" src="${path}/js/main.min.js"></script>--%>
    <%--<script type="text/javascript"></script>--%>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/perfect-scrollbar.min.js"></script>
    <!--消息提示-->
    <script src="${pageContext.request.contextPath}/static/js/bootstrap-notify.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/lightyear.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/main.min.js"></script>

    <style>
        body {
            background-color: #fff;
        }

        .lyear-login-box {
            position: relative;
            overflow-x: hidden;
            width: 100%;
            height: 100%;
            -webkit-transition: 0.5s;
            -o-transition: 0.5s;
            transition: 0.5s;
        }

        .lyear-login-left {
            width: 50%;
            top: 0;
            left: 0;
            bottom: 0;
            position: fixed;
            height: 100%;
            z-index: 555;
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center center;
        }

        .lyear-overlay {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 10;
            background: rgba(0, 0, 0, 0.5);
        }

        .lyear-logo {
            margin-bottom: 50px;
        }

        .lyear-featured {
            z-index: 12;
            position: absolute;
            bottom: 0;
            padding: 30px;
            width: 100%;
        }

        .lyear-featured h4 {
            color: #fff;
            line-height: 32px;
        }

        .lyear-featured h4 small {
            color: #fff;
            display: block;
            text-align: right;
            margin-top: 15px;
        }

        .lyear-login-right {
            margin-left: 50%;
            position: relative;
            z-index: 999;
            padding: 100px;
            background-color: #fff;
        }

        @media screen and (max-width: 1024px) {
            .lyear-login-right {
                padding: 50px;
            }
        }

        @media screen and (max-width: 820px) {
            .lyear-login-left {
                width: 100%;
                position: relative;
                z-index: 999;
                height: 300px;
            }

            .lyear-login-right {
                margin-left: 0;
            }
        }

        @media screen and (max-width: 480px) {
            .lyear-login-right {
                padding: 50px;
            }
        }

        @media screen and (max-width: 320px) {
            .lyear-login-right {
                padding: 30px;
            }
        }
    </style>
</head>


<body>
<div class="lyear-login-box">
    <c:if test="${not empty mess}">
        <script>
            alert("${mess}");
        </script>
    </c:if>
    <c:set var="rand"><%= Math.round(Math.random() * 4) %>
    </c:set>
    ${rand}
    <c:choose>
        <c:when test="${rand eq 0}">
            <div class="lyear-login-left"
                 style="background-image: url(${pageContext.request.contextPath}/static/images/login-bg-${rand+1}.jpg)">
                <div class="lyear-overlay"></div>
                <div class="lyear-featured">
                    <h4>愿你有好运气，如果没有，愿你在不幸中学会慈悲；愿你被很多人爱，如果没有，愿你在寂寞中学会宽容。
                        <small> - 刘瑜《愿你慢慢长大》</small>
                    </h4>
                </div>
            </div>
        </c:when>
        <c:when test="${rand eq 1}">
            <div class="lyear-login-left"
                 style="background-image: url(${pageContext.request.contextPath}/static/images/login-bg-${rand+1}.jpg)">
                <div class="lyear-overlay"></div>
                <div class="lyear-featured">
                    <h4>世界上只有一种真正的英雄主义，那就是在认清生活的真相后依然热爱生活。
                        <small> - 罗曼·罗兰《米开朗琪罗》</small>
                    </h4>
                </div>
            </div>
        </c:when>
        <c:when test="${rand eq 2}">
            <div class="lyear-login-left"
                 style="background-image: url(${pageContext.request.contextPath}/static/images/login-bg-${rand+1}.jpg)">
                <div class="lyear-overlay"></div>
                <div class="lyear-featured">
                    <h4> 人类的悲欢并不相通，我只觉得他们吵闹。
                        <small> - 鲁迅《而已集》</small>
                    </h4>
                </div>
            </div>
        </c:when>
        <c:when test="${rand eq 3}">
            <div class="lyear-login-left"
                 style="background-image: url(${pageContext.request.contextPath}/static/images/login-bg-${rand+1}.jpg)">
                <div class="lyear-overlay"></div>
                <div class="lyear-featured">
                    <h4>侠之大者，为国为民。
                        <small> - 金庸《射雕英雄传》</small>
                    </h4>
                </div>
            </div>
        </c:when>

        <c:when test="${rand eq 4}">
            <div class="lyear-login-left"
                 style="background-image: url(${pageContext.request.contextPath}/static/images/login-bg-${rand+1}.jpg)">
                <div class="lyear-overlay"></div>
                <div class="lyear-featured">
                    <h4>不知道自己的无知,乃是双倍的无知。
                        <small> - 柏拉图</small>
                    </h4>
                </div>
            </div>
        </c:when>
    </c:choose>


    <div class="lyear-login-right">

        <div class="lyear-logo text-center">
            <a href="#!"><img src="${pageContext.request.contextPath}/static/images/logo-sidebar.png" alt="logo"/></a>
        </div>
        <form <c:choose>
            <c:when test="${loginType eq 'sutdent'}">
                action="${pageContext.request.contextPath}/student/login"
            </c:when>
            <c:when test="${loginType eq 'teacher'}">
                action="${pageContext.request.contextPath}/teacher/login"
            </c:when>
            <c:when test="${loginType eq 'admin'}">
                action="${pageContext.request.contextPath}/admin/login"
            </c:when>
        </c:choose> method="post">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" class="form-control" id="username" name="username" placeholder="请输入您的用户名">
            </div>

            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" class="form-control" id="password" name="password" placeholder="请输入您的密码">
            </div>

            <div class="form-group">
                <label for="checkCode">验证码</label>
                <div class="row">
                    <div class="col-xs-7">
                        <input type="text" name="checkCode" id="checkCode" class="form-control" placeholder="验证码">
                    </div>
                    <div class="col-xs-5">
                        <img src="${path}/account/checkCode" class="pull-right" id="checkCodeImg"
                             style="cursor: pointer;"
                             onclick="this.src=this.src+'?d='+Math.random();" title="点击刷新" alt="captcha">
                    </div>
                </div>
            </div>

            <%--<div class="form-group">--%>
            <%--<label class="lyear-checkbox checkbox-primary m-t-10">--%>
            <%--<input type="checkbox" checked=""><span>5天内自动登录</span>--%>
            <%--</label>--%>
            <%--</div>--%>

            <div class="form-group">
                <button type="button" class="btn btn-block btn-primary" id="login">立即登录</button>
                <input type="submit" id="submit">
            </div>


            <footer class="text-center">
                <p class="m-b-0">Copyright © 2020 <a href="${path}/index.jsp">Seecen科技</a>. All right reserved
                </p>
            </footer>
        </form>

    </div>


</div>

</body>
</html>
<script>
    <%--$('#login').click(function () {--%>

    <%--// 假设ajax提交操作--%>
    <%--var username = $("#username").val();--%>
    <%--var password = $("#password").val();--%>
    <%--var checkCode = $("#checkCode").val();--%>
    <%--$.post("${path}/account/ajaxCheckLogin",--%>
    <%--"username=" + username + "&password=" + password + "&checkCode=" + checkCode,--%>
    <%--function (result) {--%>
    <%--lightyear.loading('show');--%>
    <%--if (result == "true") {--%>
    <%--setTimeout(function () {--%>
    <%--lightyear.loading('hide');--%>
    <%--lightyear.notify('登录成功，页面即将自动跳转~', 'success', 2000);--%>
    <%--$("#submit").click();--%>

    <%--}, 1e3);--%>

    <%--} else {--%>
    <%--setTimeout(function () {--%>
    <%--lightyear.loading('hide');--%>
    <%--lightyear.notify(result + "，请检查后重试~", 'danger', 2000);--%>
    <%--$("#checkCodeImg").click();--%>
    <%--}, 1e3);--%>

    <%--}--%>
    <%--});--%>

    <%--});--%>

</script>